﻿<UserControl x:Class="daigou.modules.Bill.SearchProductView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="35" />
            <RowDefinition Height="3" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" >
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />                
            </Grid.RowDefinitions>
            <DockPanel  Grid.Row="0" >
                <Label  DockPanel.Dock="Left" Content="查找" HorizontalAlignment="Left" VerticalAlignment="Center" />
                <Button DockPanel.Dock="Right" Content="清除"  Margin="5 0" Background="LightGreen" Width="50px" VerticalContentAlignment="Center" VerticalAlignment="Center" Command="{Binding CleanFilterTxtCommand}"/>
                <Button DockPanel.Dock="Right" Content="重载"  Margin="5 0" Background="BlanchedAlmond" Width="60px" VerticalContentAlignment="Center" VerticalAlignment="Center" Command="{Binding ReloadCommand}"/>
                <TextBox Text="{Binding FilterTxt, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="20" Style="{StaticResource TB_NoBorder}" ></TextBox>
            </DockPanel>         
        </Grid>

        <GridSplitter Background="DarkGray"  ResizeDirection="Rows" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ResizeBehavior="PreviousAndNext" />

        <ListView  Grid.Row="2"
                    ItemsSource="{Binding ProductList}"
                    ItemTemplate="{StaticResource  SimpleProductListTemplate}" 
                    BorderBrush="{x:Null}"
                    HorizontalAlignment="Stretch"                    
                    Name="listView" 
                    VerticalAlignment="Stretch" 
                    SelectedItem="{Binding SelectedItem}"
                    HorizontalContentAlignment="Stretch"
                    ScrollViewer.VerticalScrollBarVisibility="Auto"
                    VirtualizingStackPanel.IsVirtualizing ="True" FontSize="18">
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                </Style>
            </ListView.ItemContainerStyle>
        </ListView>

    </Grid>
</UserControl>
